# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessBusinessInformation.V1.Model.Location do
  @moduledoc """
  A location. See the [help center article] (https://support.google.com/business/answer/3038177) for a detailed description of these fields, or the [category endpoint](/my-business/reference/rest/v4/categories) for a list of valid business categories.

  ## Attributes

  *   `adWordsLocationExtensions` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.AdWordsLocationExtensions.t`, *default:* `nil`) - Optional. Additional information that is surfaced in AdWords.
  *   `categories` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.Categories.t`, *default:* `nil`) - Optional. The different categories that describe the business.
  *   `labels` (*type:* `list(String.t)`, *default:* `nil`) - Optional. A collection of free-form strings to allow you to tag your business. These labels are NOT user facing; only you can see them. Must be between 1-255 characters per label.
  *   `languageCode` (*type:* `String.t`, *default:* `nil`) - Immutable. The language of the location. Set during creation and not updateable.
  *   `latlng` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.LatLng.t`, *default:* `nil`) - Optional. User-provided latitude and longitude. When creating a location, this field is ignored if the provided address geocodes successfully. This field is only returned on get requests if the user-provided `latlng` value was accepted during create, or the `latlng` value was updated through the Google Business Profile website. This field can only be updated by approved clients.
  *   `metadata` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.Metadata.t`, *default:* `nil`) - Output only. Additional non-user-editable information.
  *   `moreHours` (*type:* `list(GoogleApi.MyBusinessBusinessInformation.V1.Model.MoreHours.t)`, *default:* `nil`) - Optional. More hours for a business's different departments or specific customers.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Google identifier for this location in the form: `locations/{location_id}`.
  *   `openInfo` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.OpenInfo.t`, *default:* `nil`) - Optional. A flag that indicates whether the location is currently open for business.
  *   `phoneNumbers` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.PhoneNumbers.t`, *default:* `nil`) - Optional. The different phone numbers that customers can use to get in touch with the business.
  *   `profile` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.Profile.t`, *default:* `nil`) - Optional. Describes your business in your own voice and shares with users the unique story of your business and offerings. This field is required for all categories except lodging categories (e.g. hotels, motels, inns).
  *   `regularHours` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.BusinessHours.t`, *default:* `nil`) - Optional. Operating hours for the business.
  *   `relationshipData` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.RelationshipData.t`, *default:* `nil`) - Optional. All locations and chain related to this one.
  *   `serviceArea` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceAreaBusiness.t`, *default:* `nil`) - Optional. Service area businesses provide their service at the customer's location. If this business is a service area business, this field describes the area(s) serviced by the business.
  *   `serviceItems` (*type:* `list(GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceItem.t)`, *default:* `nil`) - Optional. List of services supported by merchants. A service can be haircut, install water heater, etc. Duplicated service items will be removed automatically.
  *   `specialHours` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.SpecialHours.t`, *default:* `nil`) - Optional. Special hours for the business. This typically includes holiday hours, and other times outside of regular operating hours. These override regular business hours. This field cannot be set without regular hours.
  *   `storeCode` (*type:* `String.t`, *default:* `nil`) - Optional. External identifier for this location, which must be unique within a given account. This is a means of associating the location with your own records.
  *   `storefrontAddress` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.PostalAddress.t`, *default:* `nil`) - Optional. A precise, accurate address to describe your business location. PO boxes or mailboxes located at remote locations are not acceptable. At this time, you can specify a maximum of five `address_lines` values in the address. This field should only be set for businesses that have a storefront. This field should not be set for locations of type `CUSTOMER_LOCATION_ONLY` but if set, any value provided will be discarded.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Required. Location name should reflect your business's real-world name, as used consistently on your storefront, website, and stationery, and as known to customers. Any additional information, when relevant, can be included in other fields of the resource (for example, `Address`, `Categories`). Don't add unnecessary information to your name (for example, prefer "Google" over "Google Inc. - Mountain View Corporate Headquarters"). Don't include marketing taglines, store codes, special characters, hours or closed/open status, phone numbers, website URLs, service/product information, location/address or directions, or containment information (for example, "Chase ATM in Duane Reade").
  *   `websiteUri` (*type:* `String.t`, *default:* `nil`) - Optional. A URL for this business. If possible, use a URL that represents this individual business location instead of a generic website/URL that represents all locations, or the brand.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adWordsLocationExtensions =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.AdWordsLocationExtensions.t() | nil,
          :categories => GoogleApi.MyBusinessBusinessInformation.V1.Model.Categories.t() | nil,
          :labels => list(String.t()) | nil,
          :languageCode => String.t() | nil,
          :latlng => GoogleApi.MyBusinessBusinessInformation.V1.Model.LatLng.t() | nil,
          :metadata => GoogleApi.MyBusinessBusinessInformation.V1.Model.Metadata.t() | nil,
          :moreHours =>
            list(GoogleApi.MyBusinessBusinessInformation.V1.Model.MoreHours.t()) | nil,
          :name => String.t() | nil,
          :openInfo => GoogleApi.MyBusinessBusinessInformation.V1.Model.OpenInfo.t() | nil,
          :phoneNumbers =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.PhoneNumbers.t() | nil,
          :profile => GoogleApi.MyBusinessBusinessInformation.V1.Model.Profile.t() | nil,
          :regularHours =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.BusinessHours.t() | nil,
          :relationshipData =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.RelationshipData.t() | nil,
          :serviceArea =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceAreaBusiness.t() | nil,
          :serviceItems =>
            list(GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceItem.t()) | nil,
          :specialHours =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.SpecialHours.t() | nil,
          :storeCode => String.t() | nil,
          :storefrontAddress =>
            GoogleApi.MyBusinessBusinessInformation.V1.Model.PostalAddress.t() | nil,
          :title => String.t() | nil,
          :websiteUri => String.t() | nil
        }

  field(:adWordsLocationExtensions,
    as: GoogleApi.MyBusinessBusinessInformation.V1.Model.AdWordsLocationExtensions
  )

  field(:categories, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.Categories)
  field(:labels, type: :list)
  field(:languageCode)
  field(:latlng, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.LatLng)
  field(:metadata, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.Metadata)
  field(:moreHours, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.MoreHours, type: :list)
  field(:name)
  field(:openInfo, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.OpenInfo)
  field(:phoneNumbers, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.PhoneNumbers)
  field(:profile, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.Profile)
  field(:regularHours, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.BusinessHours)
  field(:relationshipData, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.RelationshipData)
  field(:serviceArea, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceAreaBusiness)

  field(:serviceItems,
    as: GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceItem,
    type: :list
  )

  field(:specialHours, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.SpecialHours)
  field(:storeCode)
  field(:storefrontAddress, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.PostalAddress)
  field(:title)
  field(:websiteUri)
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.Location do
  def decode(value, options) do
    GoogleApi.MyBusinessBusinessInformation.V1.Model.Location.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.Location do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
